import request from "../../request";
export default {
  pageList(data) {
    //获取用户列表
    return request({
      url: "TSysUser/page",
      method: "post",
      data
    });
  },
  addUser(data) {
    //添加用户
    return request({
      url: "TSysUser/save",
      method: "post",
      data
    });
  },
  updateUser(data) {
    //修改用户
    return request({
      url: "TSysUser/update",
      method: "post",
      data
    });
  },
  updateStatus(data) {
    //修改用户状态（启用，禁用）
    return request({
      url: "TSysUser/updateStatus",
      method: "post",
      data
    });
  },
  resetPassword(data) {
    // 重置密码
    return request({
      url: "TSysUser/resetPassword",
      method: "post",
      data
    });
  },
  dispatchRole(data) {
    // 给人员分配角色
    return request({
      url: "TSysUser/addRoleToUser",
      method: "post",
      data
    });
  },
  exportUser(data) {
    //导出
    return request({
      url: "TSysUser/export",
      method: "post",
      data
    });
  },
  downloadExcel(data) {
    //模板下载
    return request({
      url: "TSysUser/downloadExcel",
      // download:true,
      method: "post",
      data
    });
  },
  importExcel(data) {
    //导入
    return request({
      url: "TSysUser/inportExcel",
      method: "post",
      data,
      contentType: "multipart/form-data"
    });
  },
  template() {
    return request({
      url: "TSysUser/downloadExcel",
      method: "get",
      data: {},
      download: true
    });
  }
};
